<template>
  <el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible="crud.status.cu > 0" :title="crud.status.title" width="700px">
    <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px">
      <el-form-item label="收入、支出" prop="payType">
        <el-select v-model="form.payType" filterable placeholder="请选择">
          <el-option v-for="item in dict.dict.type_pay" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>
      </el-form-item>
      <el-form-item label="流水类型 1充值 2提现 3支付">
        <el-select v-model="form.transactionType" filterable placeholder="请选择">
          <el-option v-for="item in dict.dict.type_pay_flow" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>
      </el-form-item>
      <el-form-item label="业务类型">
        <el-select v-model="form.businessType" filterable placeholder="请选择">
          <el-option v-for="item in dict.dict.type_pay_business" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>
      </el-form-item>
      <el-form-item label="业务标识">
        <el-input v-model="form.businessSign" />
      </el-form-item>
      <el-form-item label="预支付单号">
        <el-input v-model="form.preOrderSerial" />
      </el-form-item>
      <el-form-item label="支付方名称">
        <el-input v-model="form.payerName" />
      </el-form-item>
      <el-form-item label="收款方名称">
        <el-input v-model="form.receiverName" />
      </el-form-item>
      <el-form-item label="支付描述">
        <el-input v-model="form.payDesc" />
      </el-form-item>
      <el-form-item label="支付时间">
        <el-input v-model="form.optTime" />
      </el-form-item>
      <el-form-item label="交易金额">
        <el-input v-model="form.transactionAmount" />
      </el-form-item>
      <el-form-item label="支付状态 1待处理 2成功 3失败">
        <el-select v-model="form.payStatus" filterable placeholder="请选择">
          <el-option v-for="item in dict.dict.status_pay" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue" />
        </el-select>
      </el-form-item>
      <el-form-item label="租户ID">
        <el-input v-model="form.rentUserId" />
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="text" @click="crud.cancelCU">取消</el-button>
      <el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { form } from '@crud/crud'

const defaultForm = { id: null, payType: null, transactionType: null, businessType: null, businessSign: null, preOrderSerial: null, payerName: null, receiverName: null, payDesc: null, optTime: null, transactionAmount: null, payStatus: null, rentUserId: null, sortNum: null, dataStatus: null, updateTime: null, createTime: null }
export default {
  mixins: [form(defaultForm)],
  props: {
    dict: {
      type: Object,
      required: true
    }
  },
  data() {
    return {
      rules: {
        payType: [{ required: true, message: '收入、支出不能为空', trigger: 'blur' }]
      }
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  /deep/ .el-input-number .el-input__inner {
    text-align: left;
  }
</style>
